package org.example.thread;

public class Demo3 {

    public static void main(String[] args) {
        Thread t1 = new Thread(() -> {
            for (int i = 0; i < 1000; i++) {
                System.out.println(Thread.currentThread().getName() + "  " + i);
            }
        }, "扫地");

        Thread t2 = new Thread(() -> {
            for (int i = 0; i < 1000; i++) {
                System.out.println(Thread.currentThread().getName() + "  " + i);
            }
        }, "擦窗");

        t1.setPriority(10);
        t2.setPriority(3);
        t1.start();
        t2.start();
    }
}
